{{- define "main" -}}

{{- $justify := false -}}
{{- if eq .Params.justify true -}} {{- $justify = true -}} {{- end -}}
<div class="article-container">
  <h1 class="article header title">{{- .Title | safeHTML -}}</h1>
    <article class="article markdown-body" {{- if $justify -}}style="text-align: justify;" {{- end -}}>
        {{- with .Params.cover -}}<p><img class="cover" src="{{- . | safeURL -}}" alt></p>{{- end -}}
        {{ range (.Site.RegularPages.GroupByDate "2006") }}
        <h3>{{ .Key }}</h3>
    
            <ul class="archive-list">
            {{ range (where .Pages "Type" "post") }}
                <li>
                {{ .PublishDate.Format "2006-01-02" }}
                ->
                <a href="{{ .RelPermalink }}">{{ .Title }}</a>
                </li>
            {{ end }}
        </ul>
    {{ end }}
</div>
{{- end -}}
